package xcmg.device.dao.mapper.abnormal;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.abnormal.AbnormalOutDO;
import xcmg.device.dao.entity.abnormal.AbnormalOutExportDO;
import xcmg.device.service.vo.abnormal.AbnormalOutVO;

import java.util.List;
@Mapper
public interface AbnormalOutMapper {
    int delete(String id);

    int add(AbnormalOutDO record);

    AbnormalOutDO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(AbnormalOutDO record);
    //编辑时的更新，专门使用，涉及到审核相关信息如果传null则置空，而不是传null时不处理
    int update4Edit(AbnormalOutDO record);

    List<AbnormalOutDO> list(AbnormalOutVO model);

    List<AbnormalOutDO> listNotBeCreatedDeliveryReceipt(AbnormalOutVO model);

    AbnormalOutDO item(@Param("id") String id);

    int remove(@Param("ids") List<String> ids);

    List<AbnormalOutDO> findOrderList(@Param("ids") List<String> ids);

    List<AbnormalOutDO> findForDeleteByIds(@Param("ids") List<String> ids);

    int updateStatus(@Param("status") Integer status ,@Param("billNo") String billNo);

    AbnormalOutDO selectByAbnormalNo(@Param("abnormalNo") String abnormalNo, @Param("orgId") String orgId);

    /**
     * 获取该公司下所有需要过账的非正常出库单
     *
     * @param orgId
     * @return
     */
    List<AbnormalOutDO> list4SapPosting(@Param("orgId")String orgId);

    List<AbnormalOutExportDO> selectExportList(AbnormalOutVO condition);

    int updateAuditInfo(@Param("ids") List<String> ids, @Param("auditStatus") Integer auditStatus,
                        @Param("auditRemark") String auditRemark, @Param("userId") String userId,
                        @Param("userName") String userName);

    Integer countAuditData(String orgId);
}
